<template>
  <el-container class="el-container--privilege">
    <el-container>
      <el-main>
        <vxe-table :loading="dataListLoading" :data="dataList" ref="xTable" auto-resize class="vxe-table-element"
          @select-change="dataListSelectionChangeHandleVex" @select-all="dataListSelectionAllChangeHandleVex">
          <vxe-table-column type="index" width="50" fixed="left" align="center"></vxe-table-column>
          <vxe-table-column field="name" title="role.name"></vxe-table-column>
          <vxe-table-column field="deptName" title="role.deptName" width="140" align="center"></vxe-table-column>
          <vxe-table-column field="roleGradeName" title="role.roleGradeName" width="120" align="center">
            <template slot-scope="scope">
              <el-tag style="width:70px;" v-if="scope.row.roleGrade === '1'" size="small" type="warning">
                {{ scope.row.roleGradeName }}
              </el-tag>
              <el-tag style="width:70px;" v-else-if="scope.row.roleGrade === '2'" size="small" type="success">
                {{ scope.row.roleGradeName }}
              </el-tag>
              <el-tag style="width:70px;" v-else size="small">{{ scope.row.roleGradeName }}</el-tag>
            </template>
          </vxe-table-column>
          <vxe-table-column field="createDate" title="role.createDate" sortable width="140" align="center"></vxe-table-column>
        </vxe-table>
        <el-pagination :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit" :total="total" layout="total, sizes, prev, pager, next, jumper"
          @size-change="pageSizeChangeHandle" @current-change="pageCurrentChangeHandle">
        </el-pagination>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        activatedIsNeed: false, // 此页面是否在激活（进入）时，调用查询数据列表接口？
        getDataListURL: '/sys/role/page',
        getDataListIsPage: true
      },
      dataForm: {}
    }
  },
  props: {},
  methods: {
    init () {
      this.$nextTick(() => {
        Promise.all([
        ]).then(() => {
        })
      })
    }
  }
}
</script>
